package com.cjh.crm.controller;

import com.cjh.crm.model.ReportsResult;
import com.cjh.crm.service.ICustomerService;
import org.apache.tomcat.util.net.TLSClientHelloExtractor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


@Controller
@RequestMapping("/reports")
public class ReportsController {

    @Autowired
    ICustomerService iCustomerService;


    /*

     */
    @RequestMapping("/countReports")
    public String toCountReports() {
        return "/reports/countReports";
    }


    @RequestMapping("/tocountReports")
    @ResponseBody
    public List<ReportsResult> toCountCustomer(){

        List<ReportsResult> results=iCustomerService.toCountCustomer();
        return results;
    }
}
